rate = eval(input("请输入美元跟人民币的汇率："))
type = eval(input("0：美元转换人民币；1：人民币转换美元，请选择："))
if type==0:
    money = eval(input("请输入美元金额："))
    to_money = money * rate
    print("$",format(money, ".1f"), "=$", format(to_money, ".2f"),"元")
elif type == 1 :
    money = eval(input("请输入人民币："))
    to_money = money / rate
    print(format(money,".1f"),"元=$",format(to_money,".2f"))
else:
    print("选项错误了哦。")



